package com.bincloud.vue.admin.common.exception;

/**
 * 基础异常
 * @author bincloud, mvpzhou
 */
public class BaseException extends RuntimeException {

    private static final String EXCEPTION = "500";
    private static final String EXCEPTION_CODE = "异常代码: ";
    private static final String EXCEPTION_MSG = ", 异常信息: ";

    public BaseException(String msg) {
        super(EXCEPTION_CODE + EXCEPTION + EXCEPTION_MSG + msg);
    }

    public BaseException(String code, String msg) {
        super(EXCEPTION_CODE + code + EXCEPTION_MSG + msg);
    }

    public BaseException(String msg, Throwable cause) {
        super(EXCEPTION_CODE + EXCEPTION + EXCEPTION_MSG + msg);
    }

    public BaseException(CodeMsg codeMsg) {
        super(EXCEPTION_CODE + codeMsg.getCode() + EXCEPTION_MSG + codeMsg.getMsg());
    }

    public BaseException(CodeMsg codeMsg, Throwable cause) {
        super(EXCEPTION_CODE + codeMsg.getCode() + EXCEPTION_MSG + codeMsg.getMsg(), cause);
    }

}
